package com.xxh.food.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xxh.food.common.entity.Online;
import com.xxh.food.common.entity.User;
import com.xxh.food.mapper.OnlineMapper;
import com.xxh.food.service.OnlineService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class OnlineServiceImpl extends ServiceImpl<OnlineMapper, Online> implements OnlineService {
    @Resource
    private OnlineMapper onlineMapper;

    @Override
    public int onlineNum() {
        QueryWrapper<Online> qw = new QueryWrapper<>();
        return Math.toIntExact(onlineMapper.selectCount(qw));
    }
}
